﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/TemplateAdmin.Master" Inherits="System.Web.Mvc.ViewPage<AirlineProject.Models.User>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	edituser
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<script language="javascript" type="text/javascript">
    $(document).ready(function () {
        $('.DOB').datepicker({
            changeYear: true,
            changeMonth: true,
            dateFormat: 'mm/dd/yy',
            showAnim: 'fold',
            inline: true,
            yearRange: '1950:1996',
            onSelect: function (dateText, inst) {
                //for(var key in inst){
                //alert(key);
                //}
                alert(inst['currentYear'])
                // id, input, selectedDay, selectedMonth, selectedYear, drawMonth, drawYear, inline, currentDay, currentMonth, currentYear, 

                //alert($('.mycalendar').parent().parent().parent().parent().parent().find('.ui-datepicker-year option:selected').val());
            }
        });
 </script>       
    <h2>Edit User</h2>

    <% using (Html.BeginForm()) {%>
        <%= Html.ValidationSummary(true) %>
        
        <fieldset>
            <legend>Fields</legend>
            
            <div class="editor-label">
                <%= Html.LabelFor(model => model.user_id) %>
            </div>
            <div class="editor-field">
                <%= Html.TextBoxFor(model => model.user_id) %>
                <%= Html.ValidationMessageFor(model => model.user_id) %>
            </div>
            
            <div class="editor-label">
                <%= Html.LabelFor(model => model.user_name) %>
            </div>
            <div class="editor-field">
                <%= Html.TextBoxFor(model => model.user_name) %>
                <%= Html.ValidationMessageFor(model => model.user_name) %>
            </div>
            
            <div class="editor-label">
                <%= Html.LabelFor(model => model.password) %>
            </div>
            <div class="editor-field">
                <%= Html.TextBoxFor(model => model.password) %>
                <%= Html.ValidationMessageFor(model => model.password) %>
            </div>
            
            <div class="editor-label">
                <%= Html.LabelFor(model => model.first_name) %>
            </div>
            <div class="editor-field">
                <%= Html.TextBoxFor(model => model.first_name) %>
                <%= Html.ValidationMessageFor(model => model.first_name) %>
            </div>
            
            <div class="editor-label">
                <%= Html.LabelFor(model => model.last_name) %>
            </div>
            <div class="editor-field">
                <%= Html.TextBoxFor(model => model.last_name) %>
                <%= Html.ValidationMessageFor(model => model.last_name) %>
            </div>
            
            <div class="editor-label">
                <%= Html.LabelFor(model => model.address) %>
            </div>
            <div class="editor-field">
                <%= Html.TextBoxFor(model => model.address) %>
                <%= Html.ValidationMessageFor(model => model.address) %>
            </div>
            
            <div class="editor-label">
                <%= Html.LabelFor(model => model.phone_number) %>
            </div>
            <div class="editor-field">
                <%= Html.TextBoxFor(model => model.phone_number) %>
                <%= Html.ValidationMessageFor(model => model.phone_number) %>
            </div>
            
            <div class="editor-label">
                <%= Html.LabelFor(model => model.email) %>
            </div>
            <div class="editor-field">
                <%= Html.TextBoxFor(model => model.email) %>
                <%= Html.ValidationMessageFor(model => model.email) %>
            </div>
            
            <div class="editor-label">
                <%= Html.LabelFor(model => model.gender) %>
            </div>
            <div class="editor-field">
                <%= Html.TextBoxFor(model => model.gender) %>
                <%= Html.ValidationMessageFor(model => model.gender) %>
            </div>
            
            <div class="editor-label">
                <%= Html.LabelFor(model => model.DOB) %>
            </div>
            <div class="editor-field">
                <%= Html.TextBoxFor(model => model.DOB, String.Format("{0:g}", Model.DOB.ToShortDateString()))%>
                <%= Html.ValidationMessageFor(model => model.DOB) %>
            </div>
            
            <div class="editor-label">
                <%= Html.LabelFor(model => model.rights) %>
            </div>
            <div class="editor-field">
                <%= Html.TextBoxFor(model => model.rights) %>
                <%= Html.ValidationMessageFor(model => model.rights) %>
            </div>
            
            <p>
                <input type="submit" value="Save" />
            </p>
        </fieldset>

    <% } %>

    <div>
        <%= Html.ActionLink("Back to List", "Index") %>
    </div>

</asp:Content>

